package com.example.canvas;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.FrameLayout;

import java.lang.reflect.Array;
import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

    String passType;
    String type[];

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main); //设置使用的布局文件
        Intent intent = getIntent();  //获取intent的对象
        Bundle bundle = intent.getExtras(); //获取传递的数据包
        passType = "outtype";

//        bundle.getString("passType");
        Resources res = getResources(); //获取Resources
        if("outinfo".equals(passType)){
            type = res.getStringArray(R.array.outtype); //获取支出类型数组
        }else if("ininfo".equals(passType)){
            type = res.getStringArray(R.array.intype);  //收入类型数组

        }


        FrameLayout ll = (FrameLayout)findViewById(R.id.canvas);
//        ll.addView(new TextCanvasView(this));
        ll.addView(new TestCanvasView(this));
    }

}
